/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.hutech09.jsale.web.manager.product.info;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import org.hutech09.jsale.bsn.IProductManager;
import org.hutech09.jsale.entity.InfoType;

/**
 *
 * @author Nam
 */
@ManagedBean
@RequestScoped
public class InfoTypeCuCtrl {

    @EJB
    private IProductManager pm;

    private InfoType infoType;

    private String affterApplyPage;

    public String showCreate(String affterApplyPage) {
        this.affterApplyPage = affterApplyPage;
        return "infoTypeCreatePage";
    }

    public String showUpdate(InfoType infoType, String affterApplyPage) {
        this.infoType = infoType;
        this.affterApplyPage = affterApplyPage;
        return "infoTypeCreatePage";
    }

    public String create() {
        pm.createInfoType(infoType);
        return affterApplyPage;
    }

    public String updaet() {
        pm.updateInfoType(infoType);
        return affterApplyPage;
    }

    public InfoType getInfoType() {
        return infoType;
    }

    public void setInfoType(InfoType infoType) {
        this.infoType = infoType;
    }
}
